package com.cloudpivot.receivales.workorder.controller;

import com.alibaba.fastjson.JSONObject;
import com.cloudpivot.receivales.workorder.domain.AnnotaionsDTO;
import com.cloudpivot.receivales.workorder.domain.RspReportDTO;
import com.cloudpivot.receivales.workorder.domain.WorkorderReportDTO;
import com.cloudpivot.receivales.workorder.domain.WorkorderReportRspDTO;
import com.cloudpivot.receivales.workorder.service.WorkorderPoiService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.*;

/**
 * 工单报告 对外接口
 */
@Controller
@RequestMapping("/workOrderReport")
@Slf4j
public class TestForController {


    @GetMapping("/forTestApi")
    public void testApi() {
        String s = "aaa";
        int i = Integer.parseInt(s);
        System.out.println(i);
    }

    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public String exceptionHandler(Exception exception) {
        System.out.println("all处理异常");
        exception.toString();
        return exception.toString();
    }

    @ResponseStatus(code = HttpStatus.OK)
    @ExceptionHandler(value=ArithmeticException.class)
    public void mathHandler(ArithmeticException exception) {
        System.out.println("math异常");
        exception.toString();
    }

}
